<template>
	<view class="uni_box home">
		<navbar :title='title' :yin="true">
		</navbar>
		<view class="content">
			<!-- <text class="name">{{info.title}}</text>
			<text class="time">{{info.release_time}}</text> -->
			<u-parse :html="info.content" :tag-style="style"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cont:'',
				style: {
					img: 'width:max-width:100%;height:auto;pointer-events: none;'
				},
				id:'',
				info:{
					content:''
				},
				title:''
			}
		},
		onLoad(option) {
			this.type = option.type
			if(this.type == 1){
				this.title = '服务条款'
			}else if(this.type == 2){
				this.title = '隐私协议'
			}
			this.getDetail();
		},
		onShow() {
		},
		methods: {
			async getDetail(){
				if(this.type == 1){
					let res = await this.$u.api.services({
					});
					this.info = res
				}else if(this.type == 2){
					
					let res = await this.$u.api.privacyStatement({
					});
					this.info = res
				}
				// let res = await this.$u.api.announcement_detail({
				// 	id:this.id
				// });
				// this.info = res
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fff;
	}
	.content{
		background-color: #fff;
		// padding-bottom: 150rpx;
		padding: 30rpx;
		.name{
			color: #333;
			display: block;
			text-align: center;
			font-weight: 500;
			font-size: 35rpx;
		}
		.time{
			display: block;
			text-align: right;
			margin: 20rpx 0;
			color: #666;
			font-size: 28rpx;
		}
	}
</style>
